#include <stdio.h>
#include <math.h>
void trans(short n, short b[]);
int main()
{ 	   	 	 	 	 
    short b[16], n, i, read_in = 0;
    for (i = 0; i <= 15; i++)
    { 	   	 	 	 	 
        b[i] = 0;
    }
    do
    { 	   	 	 	 	 
        printf("n=");
        read_in = scanf("%hd", &n);
        while(getchar()!='\n');   //1
    }while( n<0||read_in <1 );   //1
    trans(n, b);
    printf("the binary number is ");
    for (i = 15; i >= 0; i--)
    { 	   	 	 	 	 
        printf("%d", b[i]);   //1
    }
    printf("\n");
    return 0;
} 	   	 	 	 	 
void trans(short n, short b[])  //2
{ 	   	 	 	 	 
    int i = 0;
    while (n != 0)
    { 	   	 	 	 	 
        b[i] = n % 2;  //1
        i++; 
        n /= 2;    //1
    }
    
}